package group.program.register.full_name;

import group.program.Controller.RegisterController;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.InjectMocks;
import org.mockito.MockitoAnnotations;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;

class format {
    @InjectMocks
    private RegisterController registerController;

    @BeforeEach
    void setUp() {
        MockitoAnnotations.openMocks(this);
    }

    @Test
    void testValidateFullnameFormat() {
        String validFullName = "测试";
        assertNull(registerController.validateFullNameFormat(validFullName));
    }

    @Test
    void testInvalidFullnameFormat() {
        String invalidFullName = "ceshi";
        assertEquals("真实姓名只能由中文组成", registerController.validateFullNameFormat(invalidFullName));
    }
}
